<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>CSS 三角形</title>
  <style>
    .triangle {
      float: left;
      width: 0;
      height: 0;
      border: 50px solid transparent;
      border-color: red green blue orange;
      line-height: 0;
      font-size: 0;
    }

    .t1 {
      border-color: red transparent transparent transparent;
    }

    .t2 {
      border-color: transparent green transparent transparent;
    }

    .t3 {
      border-color: transparent transparent blue transparent;
    }

    .t4 {
      border-color: transparent transparent transparent orange;
    }
  </style>
</head>

<body>
  <div class="triangle"></div>
  <div class="triangle t1"></div>
  <div class="triangle t2"></div>
  <div class="triangle t3"></div>
  <div class="triangle t4"></div>
</body>

</html>